package com.bfly.mall.wechat.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bfly.core.base.entity.BaseEntity;

import java.io.Serializable;
import java.util.List;

/**
 * 微信公众号菜单
 *
 * @author 长沙商脉科技有限公司
 * @date 2021/1/4 14:02
 */
@TableName(value = "wechat_mp_menu", resultMap = "WeChatMpMenuResultMap")
public class WeChatMpMenu extends BaseEntity implements Serializable, Comparable<WeChatMpMenu> {

    private static final long serialVersionUID = -6929382672472876665L;

    /**
     * 公众号菜单名称
     *
     * @author 长沙商脉科技有限公司
     * @date 2021/1/4 14:03
     */
    @TableField("name")
    private String name;

    /**
     * 菜单的响应动作类型，view表示网页类型，click表示点击类型，miniprogram表示小程序类型
     *
     * @author 长沙商脉科技有限公司
     * @date 2021/1/6 14:54
     * @see com.bfly.mall.wechat.enums.WeChatMpMenuCategoryEnum
     */
    @TableField("type")
    private String type;

    /**
     * 菜单类别
     *
     * @author 长沙商脉科技有限公司
     * @date 2021/1/7 10:49
     * @see com.bfly.mall.wechat.enums.WeChatMpMenuCategoryEnum
     */
    @TableField("category")
    private int category;

    /**
     * 父菜单ID
     *
     * @author 长沙商脉科技有限公司
     * @date 2021/1/6 15:00
     */
    @TableField("parent_id")
    private int parentId;

    /**
     * 公众号Id
     *
     * @author 长沙商脉科技有限公司
     * @date 2021/1/6 19:33
     */
    @TableField("platform_id")
    private int platformId;

    /**
     * 不同菜单对应的内容
     *
     * @author 长沙商脉科技有限公司
     * @date 2021/1/6 20:18
     */
    @TableField("data")
    private String data;

    /**
     * 排序
     *
     * @author 长沙商脉科技有限公司
     * @date 2021/1/7 15:16
     */
    @TableField("seq")
    private int seq;

    @TableField(exist = false)
    private List<WeChatMpMenu> children;

    @Override
    public int compareTo(WeChatMpMenu o) {
        return this.getSeq() - o.getSeq();
    }

    public int getSeq() {
        return seq;
    }

    public void setSeq(int seq) {
        this.seq = seq;
    }

    public int getCategory() {
        return category;
    }

    public void setCategory(int category) {
        this.category = category;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public int getPlatformId() {
        return platformId;
    }

    public void setPlatformId(int platformId) {
        this.platformId = platformId;
    }

    public int getParentId() {
        return parentId;
    }

    public void setParentId(int parentId) {
        this.parentId = parentId;
    }

    public List<WeChatMpMenu> getChildren() {
        return children;
    }

    public void setChildren(List<WeChatMpMenu> children) {
        this.children = children;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
}
